﻿module Sustainalytics.Controversies {
    angular.module(controversiesModuleName).directive('bulletGraph', function () {
        return {
            restrict: 'E',
            templateUrl: '/Views/Research/Controversies/Common/BulletGraph.html',
            //replace: true,

            // use same scope as the parent scope
            scope: false,

            controller: ["$scope", function ($scope) {
                $scope.scores = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

                $scope.impactTrend = $scope.incident.impactTrend;
                $scope.riskTrend = $scope.incident.riskTrend;

                $scope.isImpactBulletHighlighted = function (score) {
                    return score <= $scope.incident.impactScore;
                };

                $scope.isRiskBulletHighlighted = function (score) {
                    return score <= $scope.incident.riskScore;
                };
            }],

            // link function for attaching event handlers and applying scope
            link: function (scope, element, attrs) {
            }
        };
    });
}